package com.sunny.design.observer.jdk;

/**
 * @author Sunny
 * @date 2020/1/15
 */
public class JDKObserverTest {

    public static void main(String[] args) {
        Question question = new Question();
        question.setUserName("Sunny");
        question.setContent("怎么学习Java??");

        BaiDu baiDu = new BaiDu();
        Teacher teacher = new Teacher("Java");
        Teacher python = new Teacher("Python");

        baiDu.addObserver(teacher);
        baiDu.addObserver(python);
        baiDu.publishQuestion(question);
    }
}
